<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<p id="help">提示信息</p>
		<p>E-mail: <input type="text" id="email" name="email"></p>
		<p>Name: <input type="text" id="name" name="name"></p>
		<p>Age: <input type="text" id="age" name="age"></p>

	</body>
	<script>
		function showHelp(help) {
			document.getElementById('help').innerHTML = help;
		}
		
		function setupHelp() {
			var helpText = [{
					'id': 'email',
					'help': '你的邮件地址'
				},
				{
					'id': 'name',
					'help': '你的名字'
				},
				{
					'id': 'age',
					'help': '你的年龄'
				}
			];
		
		     helpText.forEach(function(text) {
				 document.getElementById(text.id).onfocus = function() {
				 	showHelp(text.help);
				 }
			 });
		}
		setupHelp();
	</script>
</html>
